<template>
  <div class="see-template" id="article-content">
    <div class="template">
      <div class="header">
        <span class="title">产品详情</span>
        <i
          @click="closeAddTemplate"
          class="icon iconfont iconguanbi cl-iconfont is-circle"
        ></i>
      </div>
      <div class="main">
        <div class="mainInfo">
          <img :src="productData.imageUrl" alt="封面">
          <div>
            <span style="font-size: 14px;font-weight: 550;color:#000">产品名称 : <b style="font-size: 14px;font-weight: 550;color:#000">{{productData.productName}}</b></span>
            <span>产品code : <b>{{productData.productCode}}</b></span>
            <span>产品状态 : <b>{{productData.status}}</b></span>
          </div>
        </div>
        <div class="mainContent">
          <span><i class="el-icon-info"></i>产品价格 : <b>{{productData.price}}</b></span>
          <span><i class="el-icon-info"></i>产品分类 : <b>{{productData.productLevel}}</b></span>
          <span><i class="el-icon-info"></i>产品属性 : <b  v-for="item in productData.attributes">{{item.attributeName}}</b></span>
          <span><i class="el-icon-info"></i>创建时间 : <b>{{productData.createTime}}</b></span>
          <span><i class="el-icon-info"></i>更新时间 : <b>{{productData.lastUpdateTime}}</b></span>
        </div>
        <div class="mainEdit">
          <div>
            <span>产品描述 :</span>
            <p>{{productData.description}}</p>
          </div>
          <div>
            <span>产品详情 :</span>
            <p>{{productData.summary}}</p>
          </div>
        </div>
      </div>

      <div class="footer">
        <Debounce :time="1000">
          <button
            class="cl-button cl-button--primary_notbg"
            @click="closeAddTemplate"
          >
            取消
          </button>
        </Debounce>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["productData"],
  data() {
    return {
  
    };
  },
  created() {},
  mounted() {
    console.log("获取到的产品详情", this.productData);
  },

  methods: {
    preservation() {
      if (this.add == 1) {
        console.log("11");
        this.$emit("postCreate");
      } else {
        this.$emit("putEdit");
      }
      this.$emit("closeAddTemplate");
    },
    closeAddTemplate() {
      this.$emit("closeAddTemplate");
    },
  },
};
</script>

<style lang="scss" scoped>
.see-template {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  background: rgba(38, 38, 38, 0.8);
  z-index: 2000;
  .template {
    position: relative;
    margin: 0 0 0 auto;
    height: 100%;
    min-height: 600px;
    width: 500px;
    // padding: 10px 24px 16px;
    box-sizing: border-box;
    background: #ffffff;
    .header {
      display: flex;
      justify-content: space-between;
      border-bottom: $--border-base;
      margin-bottom: 20px;
      span {
        font-size: $--font-size-base;
        color: $--color-text-primary;
        font-weight: 550;
        line-height: 44px;
        margin-left: 20px;
      }
      i {
        line-height: 14px;
        padding: 14px;
        height: 14px;
        width: 14px;
      }
    }
    .main {
      display: flex;
      flex-direction: column;
      .mainInfo {
        padding: 10px 30px;
        img {
          margin:0 10px 0 0;
          float: left;
          width: 100px;
          height: 100px;
        }
        div {
          padding: 10px;
          display: flex;
          flex-direction: column;
          font-size: 12px;
          color: #666;
          span {
            margin:5px 0;
            b {
              margin-left: 10px;
              font-size: 14px;
              font-weight: 520;
            }
          }
        }
      }
      .mainContent {
        padding: 10px 30px;
        display: flex;
        flex-direction: column;
        font-size: 13px;
        color: #666;
        span {
          line-height: 55px;
          border-bottom: 1px solid #ECEEF1; 
          i {
            margin-right: 5px;
            color: #666;
          }
          b {
            margin-left: 10px;
            font-size: 14px;
            font-weight: 520;
            color: #000;
          }
        }
      }
      .mainEdit {
        padding: 10px 30px;
        display: flex;
        flex-direction: column;
        font-size: 13px;
        div {
          margin: 10px 0;
          color: #666;
          p {    
            padding: 8px 0;
            line-height: 16px;
            font-size: 12px;
            font-weight: 520;
            letter-spacing: 2px;
            color: #000;
          }
        }
      }
    }
    .footer {
      position: absolute;
      left: 0;
      bottom: 0;
      height: 64px;
      padding: 16px 0;
      border-top: $--border-base;
      box-sizing: border-box;
      width: 100%;
      background-color: #ffffff;
      button {
        margin: 0 30px;
      }
    }
  }
}
</style>